package com.sky.mapper;

import com.sky.entity.AddressBook;
import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AddressBookMapper {

    void insert(AddressBook addressBook);

    void deleteAddressById(AddressBook addressBook);

    void updateAddressById(AddressBook addressBook);

    AddressBook getAddressById(AddressBook addressBook);

    List<AddressBook> selectAllAddresses(AddressBook addressBook);

    AddressBook getIsDefaultTAddresses(AddressBook addressBook);

    void setDefaultByUserId(AddressBook addressBook);

    @Select("select * from address_book where id = #{addressBookId}")
    AddressBook getAddressByIdToOrder(Long addressBookId);

}
